// -----------------------------------------------------------------------
//  <copyright file="IHasDomainEvent.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2024 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://www.dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2024-04-18 09:04</last-date>
// -----------------------------------------------------------------------

namespace DaprPlus.Domain.Entity;

/// <summary>
/// 定义包含领域事件
/// </summary>
public interface IHasDomainEvent
{
    /// <summary>
    /// 领域事件集合
    /// </summary>
    IReadOnlyList<DomainEvent> DomainEvents { get; }

    /// <summary>
    /// 添加领域事件
    /// </summary>
    /// <param name="domainEvent"></param>
    void AddDomainEvent(DomainEvent domainEvent);

    /// <summary>
    /// 清空当前实体内的领域事件
    /// </summary>
    void ClearDomainEvents();
}
